<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateComplaintTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('complaint', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('user_id',false)->default(0)->index()->comment('投诉用户id');
            $table->unsignedBigInteger('dataable_id',false)->default(0)->comment('morph id');
            $table->string('dataable_type',90)->nullable()->comment('morph type');
            $table->tinyInteger('status',false)->default(0)->comment('状态');
            $table->dateTime('opera_time')->nullable()->comment('处理时间');
            $table->string('content',180)->comment('投诉内容');
            $table->text('pictures')->nullable()->comment('上传图片');
            $table->string('mask',120)->nullable()->comment('备注');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('complaint');
    }
}
